<template>
	<view class="nav">
		<partTitle :title="'潮州八景'"></partTitle>
		<view class="nav_content">
			<template v-for="item in nav">
				<navItem :key="item._id" :item="item"></navItem>
			</template>
		</view>
	</view>
</template>

<script>
	import navItem from '../../wxcomponents/index/navItem.vue'
	import partTitle from '@/wxcomponents/index/partTitle.vue'
	export default {
		components:{navItem,partTitle},
		data(){
			return{
				nav:[]
			}
		},
		created() {
			let vueComponent = this
			wx.cloud.callFunction({
				name:'getScenicNav',
				success(res){
					let nav = res.result.data
					vueComponent.nav = nav
					console.log(vueComponent.nav)
				}
			})
		}
	}
</script>

<style lang="less">
	.nav{
		width: 100%;
		height: 16rem;
		margin:4.4rem 0 1rem;
		.nav_content{
			display: flex;
			justify-content: space-around;
			flex-flow: row wrap;
			width: 100%;
			height: 15rem;
			margin: 1rem 0;
		}
	}
</style>